<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">

    <body>

        <ui:composition template="./template.xhtml">

            <ui:define name="content">
                <h:form id="form">
                            <p:panel>
                                <div id="userImage" >
                                    <p:graphicImage styleClass="userImg" value="/resources/img/users/#{userBean.user.pic}"/> 
                                </div>
                                <div id="userInfo" >
                                    <div><h:outputText value="#{userBean.user.username}" /></div>
                                    <div><h:outputText value="Name : #{userBean.user.fname} #{userBean.user.lname}" /></div>
                                </div>
                                <div class="clear"></div>
                            </p:panel>

                            <p:dataGrid var="spot" value="#{userBean.listSpots()}" columns="1"
                                        rows="9" paginator="true"
                                        paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}">

                                <p:panel header="#{spot.name}" style="font-size: 15pt">
                                    <div class="spotImage" >
                                        <p:graphicImage styleClass="spotImg" value="/pictures/#{spot.pic}"/> 
                                    </div>
                                    <div class="spotInfo">
                                        <div class="spottedby"><h:outputText value="Spotted By: #{spot.username.username}" /></div><br /><br />
                                        <div><h:outputText class="note" value="Note : #{spot.note}" /></div>
                                        <div><h:outputLink value="viewrestaurant.xhtml">#{spot.rid.name}
                                            <f:param name="restId" value="#{spot.rid.rid.toString()}"/>
                                        </h:outputLink></div>
                                    </div>
                                    <div class="clear"></div>
                                </p:panel>

                            </p:dataGrid>
                        </h:form>
            </ui:define>

        </ui:composition>

    </body>
</html>
